home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / pango-1.0 / pango / pango-glyph.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  4.2 KB  |  135 lines

  1. /* Pango
  2.  * pango-glyph.h: Glyph storage
  3.  *
  4.  * Copyright (C) 2000 Red Hat Software
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Library General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  14.  * Library General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Library General Public
  17.  * License along with this library; if not, write to the
  18.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. #ifndef __PANGO_GLYPH_H__
  23. #define __PANGO_GLYPH_H__
  24.  
  25. #include <pango/pango-types.h>
  26. #include <pango/pango-item.h>
  27.  
  28. G_BEGIN_DECLS
  29.  
  30. typedef struct _PangoGlyphGeometry PangoGlyphGeometry;
  31. typedef struct _PangoGlyphVisAttr PangoGlyphVisAttr;
  32. typedef struct _PangoGlyphInfo PangoGlyphInfo;
  33. typedef struct _PangoGlyphString PangoGlyphString;
  34.  
  35. /* 1000ths of a device unit */
  36. typedef gint32 PangoGlyphUnit;
  37.  
  38. /* Positioning information about a glyph
  39.  */
  40. struct _PangoGlyphGeometry
  41. {
  42.   PangoGlyphUnit width;
  43.   PangoGlyphUnit x_offset;  
  44.   PangoGlyphUnit y_offset;
  45. };
  46.  
  47. /* Visual attributes of a glyph
  48.  */
  49. struct _PangoGlyphVisAttr
  50. {
  51.   guint is_cluster_start : 1;
  52. };
  53.  
  54. /* A single glyph 
  55.  */
  56. struct _PangoGlyphInfo
  57. {
  58.   PangoGlyph    glyph;
  59.   PangoGlyphGeometry geometry;
  60.   PangoGlyphVisAttr  attr;
  61. };
  62.  
  63. /* A string of glyphs with positional information and visual attributes -
  64.  * ready for drawing
  65.  */
  66. struct _PangoGlyphString {
  67.   gint num_glyphs;
  68.  
  69.   PangoGlyphInfo *glyphs;
  70.  
  71.   /* This is a memory inefficient way of representing the information
  72.    * here - each value gives the byte index within the text
  73.    * corresponding to the glyph string of the start of the cluster to
  74.    * which the glyph belongs.
  75.    */
  76.   gint *log_clusters;
  77.  
  78.   /*< private >*/
  79.   gint space;
  80. };
  81.  
  82. #define PANGO_TYPE_GLYPH_STRING (pango_glyph_string_get_type ())
  83.  
  84. PangoGlyphString *pango_glyph_string_new      (void);
  85. void              pango_glyph_string_set_size (PangoGlyphString *string,
  86.                            gint              new_len);
  87. GType             pango_glyph_string_get_type (void);
  88. PangoGlyphString *pango_glyph_string_copy     (PangoGlyphString *string);
  89. void              pango_glyph_string_free     (PangoGlyphString *string);
  90. void              pango_glyph_string_extents  (PangoGlyphString *glyphs,
  91.                            PangoFont        *font,
  92.                            PangoRectangle   *ink_rect,
  93.                            PangoRectangle   *logical_rect);
  94.  
  95. void              pango_glyph_string_extents_range  (PangoGlyphString *glyphs,
  96.                                                      int               start,
  97.                                                      int               end,
  98.                                                      PangoFont        *font,
  99.                                                      PangoRectangle   *ink_rect,
  100.                                                      PangoRectangle   *logical_rect);
  101.  
  102. void pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs,
  103.                         const char       *text,
  104.                         int               length,
  105.                         int               embedding_level,
  106.                         int              *logical_widths);
  107.  
  108. void pango_glyph_string_index_to_x (PangoGlyphString *glyphs,
  109.                     char             *text,
  110.                     int               length,
  111.                     PangoAnalysis    *analysis,
  112.                     int               index_,
  113.                     gboolean          trailing,
  114.                     int              *x_pos);
  115. void pango_glyph_string_x_to_index (PangoGlyphString *glyphs,
  116.                     char             *text,
  117.                     int               length,
  118.                     PangoAnalysis    *analysis,
  119.                     int               x_pos,
  120.                     int              *index_,
  121.                     int              *trailing);
  122.  
  123. /* Turn a string of characters into a string of glyphs
  124.  */
  125. void pango_shape (const gchar      *text,
  126.           gint              length,
  127.           PangoAnalysis    *analysis,
  128.           PangoGlyphString *glyphs);
  129.  
  130. GList *pango_reorder_items (GList *logical_items);
  131.  
  132. G_END_DECLS
  133.  
  134. #endif /* __PANGO_GLYPH_H__ */
  135.